#include<stdio.h>

int rank( char a);
int whichKey( char a );

int main()
{
    char s[101];
    int i,j;
    while( scanf("%s", s) != EOF ){
    	int count = 0;
        for( i=0; s[i]!='\0'; i++ ){
            count += rank( s[i] );
            if( whichKey( s[i] ) == whichKey( s[i+1] ) )
                count += 2;
        }
        printf("%d\n", count);
    }
}


int rank( char a ){
    int ret;
         if( a=='a' || a=='d' || a=='g' || a=='j' || a=='m' || a=='p'|| a=='t' || a=='w' )
        ret = 1;
    else if( a=='b' || a=='e' || a=='h' || a=='k' || a=='n' || a=='q'|| a=='u' || a=='x' )
        ret = 2;
    else if( a=='c' || a=='f' || a=='i' || a=='l' || a=='o' || a=='r'|| a=='v' || a=='y' )
        ret = 3;
    else
        ret = 4;
    return ret;
}
    
int whichKey( char a ){
    int ret;
    if( a=='a' || a=='b' || a=='c' ) ret = 1;
    else if( a=='d' || a=='e' || a=='f' ) ret = 2;
    else if( a=='g' || a=='h' || a=='i' ) ret = 3;
    else if( a=='j' || a=='k' || a=='l' ) ret = 4;
    else if( a=='m' || a=='n' || a=='o' ) ret = 5;
    else if( a=='p' || a=='q' || a=='r' || a=='s' ) ret = 6;
    else if( a=='t' || a=='u' || a=='v' ) ret = 7;
    else if( a=='w' || a=='x' || a=='y' || a=='z' ) ret = 8;
    else if( a=='\0') ret= 9;
    return ret;
}














